//
//  VC2SearchBar.swift
//  ChapterAll
//
//  Created by Kevin on 2020/4/22.
//  Copyright © 2020 Kevin. All rights reserved.
//

import UIKit

class VC2SearchBar: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        let search = UISearchBar(frame: CGRect(x: 20, y: 200, width: 300, height: 50))
        // 光标颜色
        search.tintColor = UIColor.gray
        // 显示取消按钮
        search.setValue("取消", forKey: "cancelButtonText")
        search.showsCancelButton = true
        // 显示书签按钮
        search.showsBookmarkButton = true
        search.placeholder = "请输入搜索的内容"
        search.searchTextField.font = UIFont.systemFont(ofSize: 13)
        search.showsScopeBar = true
        view.addSubview(search)
    }
}
